<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
        xmlns:icecore="http://www.icefaces.org/icefaces/core"
       xmlns:ace="http://www.icefaces.org/icefaces/components"
       xmlns:ice="http://www.icesoft.com/icefaces/component"
       xmlns:c="http://java.sun.com/jsp/jstl/core">      
    <h:head>
        <title><h:outputText>Vorlesung #{lectureBean.lecture.name} Belegwünsche anzeigen</h:outputText></title>
    </h:head>
    <h:body>
        <ui:composition template="WEB-INF/templates/lecture.xhtml">                        
            <ui:define name="content">
                <ice:dataTable value="#{viewScoreBean.sheetBeans}"  
                               var="row"
                               varStatus="status">
                    <ice:column>
                        <ice:outputText value="#{row.sheet.name}" />                        
                    </ice:column>
                    <ice:column>
                        <ice:outputText value="#{viewScoreBean.sumScore(row.sheet, '').key}" />
                        <ice:outputText value=" von " />
                        <ice:outputText value="#{viewScoreBean.sumScore(row.sheet, '').value}" />
                        <ice:outputText value=" Punkten" />
                        <ice:outputText value="(#{(viewScoreBean.sumScore(row.sheet,'').key / viewScoreBean.sumScore(row.sheet,'').value)*100} %)" />                                                
                    </ice:column>
                    <ice:column>
                        <h:form>
                            <ice:commandLink value="+"
                                             action="#{row.toggle()}"/>
                        </h:form>
                    </ice:column>
                    <ice:columns value="#{viewScoreBean.getScore(row.sheet)}"
                                     var="col"
                                     varStatus="status"
                                     rendered="#{row.visible}">
                            <ice:outputText value="Aufgabe #{status.index + 1}" /> 
                            <br/>
                            <ice:outputText value="#{col.score}" />
                            <ice:outputText value="#{col.status}" />
                            <ice:outputText value="#{col.comment}" />
                            
                        </ice:columns>

                    
                    
                </ice:dataTable>
            </ui:define>
        </ui:composition>
    </h:body>
</html>